package com.lanou3g.dllo.baidumusic.musiclibrary.playlist;

import android.content.Context;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;

/**
 * Created by dllo on 16/6/21.
 */
public class PlaylistSingleQueue {

    private static PlaylistSingleQueue playlistSingleQueue;
    private RequestQueue requestQueue;
    private ImageLoader imageLoader;

    public RequestQueue getRequestQueue() {
        return requestQueue;
    }

    public ImageLoader getImageLoader() {
        return imageLoader;
    }

    private PlaylistSingleQueue(Context context) {
        requestQueue = Volley.newRequestQueue(context);
        imageLoader = new ImageLoader(requestQueue, new PlaylistMemoryCache());
    }

    public static PlaylistSingleQueue getPlaylistSingleQueue(Context context) {
        if (playlistSingleQueue == null) {
            synchronized (PlaylistSingleQueue.class) {
                if (playlistSingleQueue == null) {
                    playlistSingleQueue = new PlaylistSingleQueue(context);
                }
            }
        }

        return playlistSingleQueue;
    }


}
